package com.javastar.common.exception;

import lombok.Data;

/**
 * 自定义异常
 *
 * @author zxx
 * @date 2023/7/23
 */
@Data
public class NovelException extends RuntimeException{
    private static final long serialVersionUID = 1L;

    private int code;
    private String msg;

    public NovelException(ErrorCode errorCode) {
        super(errorCode.getMsg());
        this.code = errorCode.getCode();
        this.msg = errorCode.getMsg();
    }
}
